package cn.sdormitory.smartclass.dao;

import cn.sdormitory.smartclass.entity.AdClassDv;
import cn.sdormitory.smartclass.entity.ClassAttence;
import cn.sdormitory.smartclass.entity.ClassDv;
import cn.sdormitory.smartclass.vo.ClassAttenceVo;
import cn.sdormitory.smartclass.vo.ClassDvAllExportVO;
import cn.sdormitory.smartclass.vo.ClassDvAppVo;
import cn.sdormitory.smartclass.vo.ClassDvVo;
import cn.sdormitory.smartdor.entity.SdAttence;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * @创建人：zhouyang
 * @创建时间：2021/12/20 16:00
 * @version：V1.0
 */
@Mapper
public interface ClassDvDao extends BaseMapper<ClassDv> {
    int getAppClaStuDvCount(@Param("classId") Long classId, @Param("accessDate") String accessDate, @Param("timeSlot") String timeSlot);
    List<ClassDvVo> getAppClaStuDvByClaIdAndSlot(@Param("classId") Long classId, @Param("dvDate") String dvDate, @Param("timeSlot") String timeSlot);
    List<ClassDvVo> getAppClaStuByClaId(@Param("classId") Long classId);
    int getClaDvByDateAndStuNo(@Param("studentNo") String studentNo, @Param("dvDate") String dvDate, @Param("timeSlot") String timeSlot);
    int getIdByDateAndStuNo(@Param("studentNo") String studentNo, @Param("dvDate") String dvDate, @Param("timeSlot") String timeSlot);
    int updateClaDvStatus(@Param("studentNo") String studentNo, @Param("dvDate") String dvDate, @Param("dvType") String dvType, @Param("timeSlot") String timeSlot);
    int createInstructorRecordDv(@Param("dv")  AdClassDv adClassDv);
    List<ClassDvVo> getDvHistoryByUserName(@Param("username")String userName);
    ClassDvVo getDvDetailById (@Param("id")String id);

    List<ClassDvVo> getList(@Param("map") Map<String,Object> map, @Param("currIndex")Integer currIndex, @Param("pageSize") Integer pageSize);

    int getListCount(@Param("map") Map<String,Object> map);

    int updatePunishStatus(@Param("vo") ClassDvVo vo);

    List<ClassDvAllExportVO> exportDvData(@Param("map")Map<String,Object> map);

//    @Select("SELECT * FROM class_dv WHERE student_no = #{studentNo}")
    List<ClassDvAppVo> findClassDvByStuNo(@Param("studentNo")String studentNo);
}
